string permutation interview